package com.atguigu.educms.controller;

import com.atguigu.commonutils.pojo.R;
import com.atguigu.educms.entity.CrmBanner;
import com.atguigu.educms.service.CrmBannerService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 东渡素玄
 * @since 2022-09-16
 */
@RestController
@RequestMapping("/educms/bannerfront")
@CrossOrigin
public class BannerFrontController {

    @Resource
    private CrmBannerService crmBannerService;

    @ApiOperation("查询所有banner")
    @GetMapping("getAllBanner")
    public R getAllBanner(){


        List<CrmBanner> crmBanners = crmBannerService.selectAllBanner();
        return R.ok().data("list",crmBanners);
    }

}
